UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'MGDpMfApswtMXg8PWjEbaYo3NfyQPuy0edfEzXdc9M0='
WHERE
key_id = 'a03b1d7783359a283f752d73d5df78d950305939da733dbe6b6134b83fc8fbdc'
AND (
token = 'MGDpMfApswtMXg8PWjEbaYo3NfyQPuy0edfEzXdc9M0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)