UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/MJQ5qyE/iVPLCS47EFr6WNil/4QmQoehDqIQtx2Ok4=' 
WHERE 
  key_id = 'dbb3b2178b9706390fe85c195dc37140c04670fe7f47c62110ff5f41930f97e2' 
  AND (
    token = '/MJQ5qyE/iVPLCS47EFr6WNil/4QmQoehDqIQtx2Ok4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047