UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ozEj5uFE+XedABtuiFaOc+URCPTA2En+k+6wcJth3gI='
WHERE
key_id = '62b28db18d865a8dbd1571320239ceca9cebe13807f9bc0ac9c4f9f150070b05'
AND (
token = 'ozEj5uFE+XedABtuiFaOc+URCPTA2En+k+6wcJth3gI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)