UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iFgk4MU48xPhSo74DEmW7qMq48jhJ3QJ6TbtT4MsRVs='
WHERE
key_id = '6efcf1794bd579c9b9ee483ebdd09ce16f9c2dcf8471fd3b94fbf35d4d06d0bb'
AND (
token = 'iFgk4MU48xPhSo74DEmW7qMq48jhJ3QJ6TbtT4MsRVs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)