UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'mztnNqbNIl0Tk/dK0ItgqXZ/TfDhAU1hAlUj+p+dhJ4=' 
WHERE 
  key_id = '43907b860cb626f17460e8d737f8dae62c8e0b587971a984ea23f968dfe8b6d2' 
  AND (
    token = 'mztnNqbNIl0Tk/dK0ItgqXZ/TfDhAU1hAlUj+p+dhJ4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033