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