UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Wjgwly8upLDTLir7ZoKeGLeFGBSCbUFMTpcRbX8rYLA=' 
WHERE 
  key_id = '03af0010373710c4c9d0287da7db8d1a392df74f5beafcce183f46d09b773f36' 
  AND (
    token = 'Wjgwly8upLDTLir7ZoKeGLeFGBSCbUFMTpcRbX8rYLA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029