UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q/7NNGG9GJ7C/ijhdHCUIFjPShiqRL07nL1UCjaGQDU='
WHERE
key_id = '7a4b8d168308de9a14338f88e31c648b1597819296d182a24dbcb6fae081c153'
AND (
token = 'q/7NNGG9GJ7C/ijhdHCUIFjPShiqRL07nL1UCjaGQDU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)