UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TltVtqvYdoK/6n7r5Ois9Qsul5GP6j2ZUXgWxt/8SzA='
WHERE
key_id = '4a41c7d4518b1dedd364e6d746510de1fea2ef18f6542e3a556c5f0071465fd9'
AND (
token = 'TltVtqvYdoK/6n7r5Ois9Qsul5GP6j2ZUXgWxt/8SzA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)