UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '074KgDsNe3FZ7m+Z5vVXzMR7L8MJ9IPz33EXGAJbg6Y='
WHERE
key_id = '8a20301f1337ef34674a26413c867a425d56b13f6b4b8c524959ad84a9420b6e'
AND (
token = '074KgDsNe3FZ7m+Z5vVXzMR7L8MJ9IPz33EXGAJbg6Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)