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