UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'B88bKFuuhKxmvY8oYA/7s+8Q4PlKdGYxiNoiM1aIWDs=' 
WHERE 
  key_id = 'c45dbdf7c1e4cfc39a2d1efa57d0d657f535d8eda1e1dea19068c0b48747d4df' 
  AND (
    token = 'B88bKFuuhKxmvY8oYA/7s+8Q4PlKdGYxiNoiM1aIWDs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025