UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'c8YDJ/4DciYn3yStfPJrIrQtSvU8MwK9fwWaDx21bMI=' 
WHERE 
  key_id = '19dacd21eb8d5d16463f35fa87c726e829265cb122980b22252d14e5c3add4f9' 
  AND (
    token = 'c8YDJ/4DciYn3yStfPJrIrQtSvU8MwK9fwWaDx21bMI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00019