UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5JicKw1AcxyJwpAGyIBUg3UOeAsEp8YOsW74jxqu/0Q='
WHERE
key_id = '8eb46c4733ecbac4c39a93cfc6bf2d5ee3d7d792faead94a03dd222176d5afd0'
AND (
token = '5JicKw1AcxyJwpAGyIBUg3UOeAsEp8YOsW74jxqu/0Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)