UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/CZlxu1sbL78dMsBfWgujuzfhSLYos+61Hhj6R2RqkA=' 
WHERE 
  key_id = '717b8667809d2e75d6aab7d9edb5dd5bdd25c072b2a777e36555a2a11f718e56' 
  AND (
    token = '/CZlxu1sbL78dMsBfWgujuzfhSLYos+61Hhj6R2RqkA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00033