UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'gUqcd0mNGvVBjsVAFD4hENs40J8eWNbp/dijJKmZJGs='
WHERE
key_id = '81db2dce11882025eac096128c01c047023099615cb73dfd763ad45196530629'
AND (
token = 'gUqcd0mNGvVBjsVAFD4hENs40J8eWNbp/dijJKmZJGs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)