UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IWyWJSmriyai4xQQQVnwjBvyqgnFm4x61OSi/qwfUoA=' 
WHERE 
  key_id = '85045a7c651167a85721911c2691f25d745ef0a95fc3e005601d5ccdb3b3a38f' 
  AND (
    token = 'IWyWJSmriyai4xQQQVnwjBvyqgnFm4x61OSi/qwfUoA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030