UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'nvfunX02YNEJUw7jiYkc39GbCkiJK7ME0dJQ8YZ/6JA=' 
WHERE 
  key_id = 'd583a1f14f059684f2d148e8e886e3922fb6b1060bc3b02632f7e6f6f06d73fc' 
  AND (
    token = 'nvfunX02YNEJUw7jiYkc39GbCkiJK7ME0dJQ8YZ/6JA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030