UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'i0f/7/m0/SPtvs+zv0tfdoPBznR/y14hVnk8zVzEeuo='
WHERE
key_id = 'a67005a58f214c80ce8b71c1c1a288a4d1c1043bc4042043f89414d5d8c40082'
AND (
token = 'i0f/7/m0/SPtvs+zv0tfdoPBznR/y14hVnk8zVzEeuo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)