UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'EoXikMamLoET8xmqvEndKG2Nw2GcNu4fioIDeHO9DlM=' 
WHERE 
  key_id = '526cd3a4b023b10ff85a9ca1972bfe40a3536bf76caf7a72b768f5daf9d15a63' 
  AND (
    token = 'EoXikMamLoET8xmqvEndKG2Nw2GcNu4fioIDeHO9DlM=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00045