UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'cJFffQ474hyfftsXZ5RZ/mg9JulDv6XJJvIJHOH6fUM=' 
WHERE 
  key_id = '85bd1754db778f20484340a62b87918e74aca7e5423a208499bcb4582f174316' 
  AND (
    token = 'cJFffQ474hyfftsXZ5RZ/mg9JulDv6XJJvIJHOH6fUM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033