UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'PgzWLRUFGycY8TxSc6C8bORTRkSWKi/XZvRzcguCjM0=' 
WHERE 
  key_id = 'ee80a03f4b209835420cf9756529fdb4e1dd6d48b531c985c303ba8d3a854c9d' 
  AND (
    token = 'PgzWLRUFGycY8TxSc6C8bORTRkSWKi/XZvRzcguCjM0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00028