UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/93rWDMmXxZPmPZzcw0rRXy43bcGpmxvMe7WxlYqKTc='
WHERE
key_id = 'c2f7645242a9e8a7626084a0f1a57f9bf8af8553dd6d504e57b9db40dfa4937c'
AND (
token = '/93rWDMmXxZPmPZzcw0rRXy43bcGpmxvMe7WxlYqKTc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)