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