UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iBvOkST+sZXJbA97DuhRdqqg1+5UBSDAw9GhVDKoIjY='
WHERE
key_id = '1cb644233cbeecfc9e9bec2da4cef0d06f442a1c911f07b9341b70cb4771817d'
AND (
token = 'iBvOkST+sZXJbA97DuhRdqqg1+5UBSDAw9GhVDKoIjY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)