UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'RDrKlkvLyf/kLiONJfNmWs7+pvpwGg2SG8j884cpxzw='
WHERE
key_id = 'ed516972c029cd364ab32c27b2aafc46949a7a746b32f49cea3c3e23d4ef43a0'
AND (
token = 'RDrKlkvLyf/kLiONJfNmWs7+pvpwGg2SG8j884cpxzw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)